package org.jeecg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.utils.Result;
import org.jeecg.domain.InstitutionStaff;
import org.jeecg.domain.dto.InstitutionStaffDto;
import org.jeecg.service.InstitutionStaffService;
import org.jeecg.mapper.InstitutionStaffMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author Administrator
* @description 针对表【institution_staff(机构下属服务人员)】的数据库操作Service实现
* @createDate 2024-12-26 11:58:02
*/
@Service
public class InstitutionStaffServiceImpl extends ServiceImpl<InstitutionStaffMapper, InstitutionStaff>
    implements InstitutionStaffService{
    @Resource
    InstitutionStaffMapper institutionStaffMapper;
    /**
    * @Author: 孟庆磊
    * @Description: 获取机构人员列表
    * @DateTime: 2024/12/26 0026 13:40
    * @Params: [institutionStaffDto]
    * @Return org.jeecg.Result
    */
    @Override
    public Result getStaffList(InstitutionStaffDto dto) {
        Page<InstitutionStaff> institutionStaffPage = new Page<>(dto.getPageNum(),dto.getPageSize());
        LambdaQueryWrapper<InstitutionStaff> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(StringUtils.isNotBlank(dto.getName()),InstitutionStaff::getName,dto.getName());
        Page<InstitutionStaff> institutionStaffPage1 = institutionStaffMapper.selectPage(institutionStaffPage, queryWrapper);
        return Result.success(institutionStaffPage1);
    }
}




